# 创建数据库
create database alioth_dev;
# 创建mysql用户
create user 'alioth'@'%' identified by 'alioth';
# 设置mysql用户权限
grant select,insert,update,delete,alter,create,index,references on alioth_dev.* to 'alioth'@'%';
# 刷新权限
flush privileges;

CREATE TABLE `mao_demo`
(
    `id`          bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '自增主键',
    `biz_no`      varchar(64) COLLATE utf8mb4_general_ci  DEFAULT NULL COMMENT '业务号',
    `key`         varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
    `value`       text COLLATE utf8mb4_general_ci,
    `deteled`     tinyint(1)                              DEFAULT NULL COMMENT '删除标识',
    `create_time` datetime                                DEFAULT NULL COMMENT '创建时间',
    `update_time` datetime                                DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    UNIQUE KEY `INX_BIZ_NO` (`biz_no`) USING BTREE COMMENT '业务号唯一'
) ENGINE = InnoDB
  AUTO_INCREMENT = 2
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_general_ci COMMENT ='测试demo表';

-- ----------------------------
-- Records of mao_demo
-- ----------------------------
BEGIN;
INSERT INTO `mao_demo`
VALUES (1, '10001', '猫哥', '喵喵喵🐱', 0, SYSDATE(), SYSDATE());
COMMIT;